﻿using System.Linq.Expressions;

namespace Farming.Repositories
{
    public interface IRepository<T> where T : class, new()
    {
        Task<int> AddAsync(T entity);
        Task<int> AddRangeAsync(List<T> entities);
        Task<int> BatchDelAsync(Expression<Func<T, bool>> expression);
        Task<int> BatchUpdAsync(List<T> entities);
        Task<int> DelAsync(int Id);
        Task<IList<T>> GetAllAsync();
        Task<T> GetByIdAsync(int id);
        Task<T> GetByIdAsync(Expression<Func<T, bool>> expression);

        Task<List<T>> GetValueAsync(Expression<Func<T, bool>> expression);
        Task<int> UpdAsync(T entity);
    }
}